<?php

namespace App\Library;

use SeasLog;
use function Hyperf\Support\now;
class MySeasLog
{
    /**
     * writer
     * @param array $arr
     * @return void
     */
    public static function writer(array $arr): void
    {
        if (!class_exists(SeasLog::class)) return;
        SeasLog::setLogger('default/' . now()->format('Y/m/d/H'));
        SeasLog::critical(json_encode(array_merge($arr, ['microsecond' => now()->format('u')]), JSON_UNESCAPED_UNICODE));
    }
}
